import request from '@/utils/request'

// 查询生产补料单头列表
export function listReplenishment(query) {
  return request({
    url: '/wm/replenishment/list',
    method: 'get',
    params: query
  })
}

// 查询生产补料单头详细
export function getReplenishment(issueId) {
  return request({
    url: '/wm/replenishment/' + issueId,
    method: 'get'
  })
}

// 新增生产补料单头
export function addReplenishment(data) {
  return request({
    url: '/wm/replenishment',
    method: 'post',
    data: data
  })
}

// 修改生产补料单头
export function updateReplenishment(data) {
  return request({
    url: '/wm/replenishment',
    method: 'put',
    data: data
  })
}

// 删除生产补料单头
export function delReplenishment(issueId) {
  return request({
    url: '/wm/replenishment/' + issueId,
    method: 'delete'
  })
}

//执行出库
export function execute(issueId) {
  return request({
    url: '/wm/replenishment/' + issueId,
    method: 'put'
  })
}

// 新增生产领料
export function getReplenishmentList(query) {
  return request({
    url: '/wm/replenishment/getReplenishmentList',
    method: 'get',
    params: query
  })
}
